package com.hthy.futures.ui.fragment;

import android.graphics.Bitmap;
import android.view.View;
import android.widget.ImageView;

import com.google.zxing.WriterException;
import com.hthy.futures.R;
import com.hthy.futures.base.BaseFragment;
import com.hthy.futures.utils.QrCodeUtils;

import butterknife.Bind;

/**
 * 分享
 * Author:  Mr.bingley
 * Version:
 * Date:  2017/5/8
 */

public class ShareFragment extends BaseFragment {
    @Bind(R.id.iv_qr_code)
    ImageView mIvScanCode;

    @Override
    protected int getLayoutId() {
        return R.layout.act_share;
    }

    @Override
    protected void initWidget(View root) {
        super.initWidget(root);
        // 生成二维码
        try {
            Bitmap bitmap = QrCodeUtils.Create2DCode("helloworld");
            mIvScanCode.setImageBitmap(bitmap);
        } catch (WriterException e) {
            e.printStackTrace();
        }
    }
}
